GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
mark.george
/
Wiki
Compare Revisions
View Page
Back to Page History
tmux.md
### Create new session ``` tmux ``` ### Detach from session <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>d</kbd> ### Attach to existing session ``` tmux attach ``` If you forgot to detach then you won't be able to attach unless you detach existing sessions using: ``` tmux attach -d ``` ### View sessions/windows In `tmux` you can use: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>w</kbd> From command line you can use: ``` # view sessions tmux ls # attach to specific session tmux attach -t <session ID> ``` ### Enable mouse wheel scrolling Enter command mode with: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>:</kdb> Then enter: ``` set mouse on ``` This enables a bunch of other mouse options as well including a context menu on right click. Mouse selection works by default and will copy on select. ### Scrolling and selecting with keyboard Enable scroll mode with: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>[</kdb> You can then scroll with arrow keys and page up/down. Press <kbd>Enter</kbd> to quit scroll mode. ### Selecting and copying Vi mode seems to be the easiest option. Set Vi mode by entering command mode with: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>:</kdb> And enter: ``` set mode-keys vi ``` Use standard Vi keys for selection, and <kbd>Enter</kbd> to yank and exit selection mode. ## #Move Windows to New Session <kbd>leader</kbd> + <kbd>.</kbd> dest-session-id <kbd>:</kbd> ### Rename Session leader $ ### Rename Window leader ,
### Create new session ``` tmux ``` ### Detach from session <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>d</kbd> ### Attach to existing session ``` tmux attach ``` If you forgot to detach then you won't be able to attach unless you detach existing sessions using: ``` tmux attach -d ``` ### View sessions/windows In `tmux` you can use: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>w</kbd> From command line you can use: ``` # view sessions tmux ls # attach to specific session tmux attach -t <session ID> ``` ### Enable mouse wheel scrolling Enter command mode with: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>:</kdb> Then enter: ``` set mouse on ``` This enables a bunch of other mouse options as well including a context menu on right click. Mouse selection works by default and will copy on select. ### Scrolling and selecting with keyboard Enable scroll mode with: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>[</kdb> You can then scroll with arrow keys and page up/down. Press <kbd>Enter</kbd> to quit scroll mode. ### Selecting and copying Vi mode seems to be the easiest option. Set Vi mode by entering command mode with: <kbd>ctrl</kbd>+<kbd>b</kbd> <kbd>:</kdb> And enter: ``` set mode-keys vi ``` Use standard Vi keys for selection, and <kbd>Enter</kbd> to yank and exit selection mode.